/*--------------------------------------------- Noble Steed Engine--------------------------------------*
Authors : Daniel Randle, Alex Bourne
Date Created : April 12 2013

File:
	nsmapbuildtool.cpp

Description:
	This file contains the definition for the NSMapBuildTool class and any associated functions that help
	the ol' girl out
*-----------------------------------------------------------------------------------------------------*/

#include <nsmapbuildtool.h>
#include <nsselectionmodel.h>
#include <nsobjectreference.h>

#ifdef DEBUG
#include <debug.h>
#endif

/*------------------------------*
|   class NSMapBuilTool BEGINS  |
*-------------------------------*/

std::string NSMapBuildTool::getName() const
{
	return toolName;
}

void NSMapBuildTool::setFromSelection(NSSelectionModel * sel)
{
	items.clear();
	NSSelectionModel::Iterator iter = sel->begin();
	while (iter != sel->end())
	{
		Item item;
		item.base = (*iter)->getBase();
		item.pos = (*iter)->getPosition();
		item.rot = (*iter)->getOrientation();
		items.push_back(item);
		++iter;
	}
}

void NSMapBuildTool::setName(const std::string & name)
{
	toolName = name;
}